package com.liu.usky.rlzp.uskyrlzp.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.liu.usky.rlzp.uskyrlzp.entity.Template;
import com.liu.usky.rlzp.uskyrlzp.mapper.TemplateMapper;
import com.liu.usky.rlzp.uskyrlzp.service.ITemplateService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 模板 服务实现类
 * </p>
 *
 * @author lcjzl
 * @since 2020-01-10
 */
@Service
public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> implements ITemplateService {

    @Override
    public boolean isRepeat(Template template) {
        QueryWrapper<Template> templateWrapper =  new QueryWrapper<>(template);
        Template isHaved = getOne(templateWrapper);
        if(isHaved != null){
            return true;
        }
        return false;
    }
}
